package StudyCode.summary.Basic.myint;

import java.util.Scanner;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class RegularPolygon {
	public static void main(String[] args) {
		double side = 0;
		double n = 0;

		Scanner scanner = new Scanner(System.in);
		System.out.println("请输入正多边形边长并回车:");
		side = scanner.nextDouble();
		System.out.println("请输入正多边形边个数并回车:");
		n = scanner.nextInt();
		double area = n * side * side / (4 * Math.tan(Math.PI / n));
		System.out.println("正多边形面积是:" + area);
	}
}
